package com.hsgene.user.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.generator.dto.GeneratorDto;
import com.hsgene.user.service.api.impl.GeneratorServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * ID生成器APIService
 *
 * @author wangbing
 * @version 1.0, 2018/7/13
 */
@FeignClient(name = "ms-mod-generator", path = "/v1.0/genetic/testing/generator", fallbackFactory = GeneratorServiceImpl.class)
public interface GeneratorService {

    /**
     * 获取生成id
     *
     * @param type   id类型
     * @param prefix id前缀
     * @return 生成结果
     */
    @RequestMapping(value = "", method = RequestMethod.GET)
    ApiResult<GeneratorDto> getGenerator(
            @RequestParam(name = "type", required = false) String type,
            @RequestParam(name = "prefix", required = false) String prefix);
}
